# Default values for kubeedge.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
appVersion: "1.13.0"

cloudCore:
  replicaCount: 1
  hostNetWork: "{{ edgeruntime.kubeedge.cloudCore.hostNetWork | default("false", true) }}"
  image:
    repository: {{ cloudcore_repo }}
    tag: {{ cloudcore_tag }}
    pullPolicy: "IfNotPresent"
    pullSecrets: []
  securityContext: {}
  labels:
    k8s-app: kubeedge
    kubeedge: cloudcore
  annotations: {}
  affinity:
    nodeAffinity:
      requiredDuringSchedulingIgnoredDuringExecution:
        nodeSelectorTerms:
        - matchExpressions:
          - key: node-role.kubernetes.io/edge
            operator: DoesNotExist
  tolerations: {}
  nodeSelector: {}
{% if edgeruntime.kubeedge.cloudCore.resources is not defined %}
  resources:
    limits:
      cpu: 200m
      memory: 1Gi
    requests:
      cpu: 100m
      memory: 512Mi
{% elif edgeruntime.kubeedge.cloudCore.resources.limits %}
  resources:
    limits:
      cpu: {{ edgeruntime.kubeedge.cloudCore.resources.limits.cpu }}
      memory: {{ edgeruntime.kubeedge.cloudCore.resources.limits.memory }}
{% elif edgeruntime.kubeedge.cloudCore.resources.requests %}
    requests:
      cpu: {{ edgeruntime.kubeedge.cloudCore.resources.requests.cpu }}
      memory: {{ edgeruntime.kubeedge.cloudCore.resources.requests.memory }}
{% endif %}
  modules:
    cloudHub:
      advertiseAddress: 
{% for addr in edgeruntime.kubeedge.cloudCore.cloudHub.advertiseAddress %}
      - {{ addr }}
{% endfor %}             
      nodeLimit: "1000"
      websocket:
        enable: "true"
      quic:
        enable: "false"
        maxIncomingStreams: "10000"
      https:
        enable: "true"
    cloudStream:
      enable: "true"
    dynamicController:
      enable: "false"
    router:
      enable: "false"
  service:
    enable: "true"
    type: "NodePort"
    cloudhubNodePort: "{{ edgeruntime.kubeedge.cloudCore.service.cloudhubNodePort | default("30000") }}"
    cloudhubQuicNodePort: "{{ edgeruntime.kubeedge.cloudCore.service.cloudhubQuicNodePort | default("30001") }}"
    cloudhubHttpsNodePort: "{{ edgeruntime.kubeedge.cloudCore.service.cloudhubHttpsNodePort | default("30002") }}"
    cloudstreamNodePort: "{{ edgeruntime.kubeedge.cloudCore.service.cloudstreamNodePort | default("30003") }}"
    tunnelNodePort: "{{ edgeruntime.kubeedge.cloudCore.service.tunnelNodePort | default("30003") }}"

iptablesManager:
  enable: "{{ edgeruntime.kubeedge.iptablesManager.enabled | default("true", true)}}"
  mode: "{{ edgeruntime.kubeedge.iptablesManager.mode | default("external") }}"
  hostNetWork: true
  image:
    repository: {{ iptables_manager_repo }}
    tag: {{ iptables_manager_tag }}
    pullPolicy: "IfNotPresent"
    pullSecrets: []
  securityContext: 
    capabilities:
      add:
        - NET_ADMIN
        - NET_RAW
  labels:
    k8s-app: iptables-manager
    kubeedge: iptables-manager
  annotations: {}
  affinity:
    nodeAffinity:
      requiredDuringSchedulingIgnoredDuringExecution:
        nodeSelectorTerms:
        - matchExpressions:
          - key: node-role.kubernetes.io/edge
            operator: DoesNotExist
  tolerations: {}
  nodeSelector: {}
{% if edgeruntime.kubeedge.iptablesManager.resources is not defined %}
  resources:
    limits:
      cpu: 200m
      memory: 50Mi
    requests:
      cpu: 100m
      memory: 25Mi
{% elif edgeruntime.kubeedge.iptablesManager.resources.limits %}
  resources:
    limits:
      cpu: {{ edgeruntime.kubeedge.iptablesManager.resources.limits.cpu }}
      memory: {{ edgeruntime.kubeedge.iptablesManager.resources.limits.memory }}
{% elif edgeruntime.kubeedge.iptablesManager.resources.requests %}
    requests:
      cpu: {{ edgeruntime.kubeedge.iptablesManager.resources.requests.cpu }}
      memory: {{ edgeruntime.kubeedge.iptablesManager.resources.requests.memory }}
{% endif %}

edgeService:
  replicaCount: 1
  image:
    repository: {{ edge_service_repo }}
    tag: {{ edge_service_tag }}
    pullPolicy: "IfNotPresent"
    pullSecrets: []
  securityContext: {}
  labels:
    k8s-app: edgeservice
  annotations: {}
  affinity:
    nodeAffinity:
      requiredDuringSchedulingIgnoredDuringExecution:
        nodeSelectorTerms:
        - matchExpressions:
          - key: node-role.kubernetes.io/edge
            operator: DoesNotExist
  tolerations: {}
  nodeSelector: {}
{% if edgeruntime.kubeedge.edgeService.resources is not defined %}
  resources:
    limits:
      cpu: 200m
      memory: 50Mi
    requests:
      cpu: 100m
      memory: 25Mi
{% elif edgeruntime.kubeedge.edgeService.resources.limits %}
  resources:
    limits:
      cpu: {{ edgeruntime.kubeedge.edgeService.resources.limits.cpu }}
      memory: {{ edgeruntime.kubeedge.edgeService.resources.limits.memory }}
{% elif edgeruntime.kubeedge.edgeService.resources.requests %}
    requests:
      cpu: {{ edgeruntime.kubeedge.edgeService.resources.requests.cpu }}
      memory: {{ edgeruntime.kubeedge.edgeService.resources.requests.memory }}
{% endif %}